
rm -f *.eps Frac*.root

pwd > gsi_dir
#ls
echo
echo

for tpctof in $(echo TPC1TOF1 TPC1TOF0)
do
    for jpt in $(echo 5-10 10-15 15-20 5-100 20-100 0-100)
    do
        for id in $(echo 60 70 80)
        do

            if [ $tpctof != TPC1TOF0 -a $id != 60 ]
            then
                continue
            fi

            if [ $jpt == 0-100 -a $id != 60 ]
            then
                continue
            fi

            echo $tpctof $id $jpt

            for ipar in $(echo 2 0 1 3 )
            do
            
                klogx=0
                if [ $id == 60 ]
                then
                    klogx=1
                fi
    
                klogy=0
                if [ $ipar == 3 ]
                then
                    klogy=1; 
                fi
                
                
                tag=RecMC$tpctof\JPT$jpt\GrID$id
                f1=$(find histRec*$tpctof*JPT$jpt\_*id$id\.root)
                f2=$(find *_$tpctof\_GrID$id\_JPT$jpt\_Combined*.root)
                echo f1 $f1
                echo f2 $f2
                f3=
                f4=
                f5=
                f6=
                aliroot -b -l -q 'drawFractionRatio.C("'$tag'",'$ipar', "'$f1'","'$f2'","'$f3'","'$f4'","'$f5'","'$f6'",0,"ratio to ref.",13,'$klogx','$klogy')'
                
                echo
                echo
            done
        done
    done
done
